/*
============================================================================
Name        : LuaUIAppUi.cpp
Author      : Jian
Version     :
Copyright   : Jian
Description : Main application UI class (controller)
============================================================================
*/

// INCLUDE FILES
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include <stringloader.h>
#include <LuaUI.rsg>
#include <f32file.h>
#include <s32file.h>

#include "LuaUIAppUi.h"
#include "LuaUIAppView.h"
#include "LuaUI.hrh"

#include "LuaUI.hrh"
#include <LuaUi.rsg>

#include "mxml.h"
#include "dd_test.h"
#include "dd_main.h"


CLuaUIAppUi::CLuaUIAppUi()
{
    // No implementation required
}

CLuaUIAppUi::~CLuaUIAppUi()
{
    if ( iAppView )
    {
        delete iAppView;
        iAppView = NULL;
    }

}

void CLuaUIAppUi::ConstructL()
{
    BaseConstructL(EAknEnableSkin);

    iAppView = CLuaUIAppView::NewL( ClientRect() );

    FILE *fp;
    mxml_node_t *tree;

    fp = fopen("c:\\test.xml", "r");
    tree = mxmlLoadFile(NULL, fp, MXML_TEXT_CALLBACK);
    fclose(fp);
}


void CLuaUIAppUi::HandleCommandL( TInt aCommand )
{
    switch( aCommand )
    {
    case ELuaUICmdTest:
        lui_init() ;
        if (dd_test())
        {
            int xx = 1 ;
            xx++ ;
        }
        lui_deinit() ;
        break;

    case EEikCmdExit:
    case EAknSoftkeyExit:
        Exit();
        break;
    default:
        break;
    }
}

void CLuaUIAppUi::HandleStatusPaneSizeChange()
{
    iAppView->SetRect( ClientRect() );
}

/* End of File */
